import React from 'react';
import { Pagination } from 'antd';

import './PaginationDefault.scss'


const PaginationDefault = ({ current, total, handleSwitchCase }) => {

    const itemRender = (_, type, originalElement) => {
        if (type === 'page') {
            return <span className='pagination-item'>案例{_}</span>;
        }
        return originalElement;
    };

    const handleChange = (page) => {
        handleSwitchCase(page - 1)
    }

    return (
        <div className={'task-detail-pagination'}>
            <Pagination
                current={current + 1}
                total={total}
                pageSize={1}
                itemRender={itemRender}
                onChange={handleChange}
                showSizeChanger={false}
            />
        </div>
    );
};
export default PaginationDefault;